package XmlNetty;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;


public class XmlUtil {
	public static byte[] readXml(String filename) throws Exception{
		File file = new File(filename);
		byte[] bfile = null;
		if(file.exists()){
			FileInputStream input = new FileInputStream(file);
			bfile= new byte[input.available()];
			input.read(bfile);
			input.close();
		}
		return bfile;
	}
	
	public static boolean writeXml(byte[] bfile,String filename) throws Exception{
		File file = new File(filename);
		if(!file.exists()){
			file.createNewFile();
		}
		FileOutputStream output = new FileOutputStream(file);
		output.write(bfile);
		output.close();
		System.out.println("111111111111111111111111111111111111111111");
		return false;
	}
}
